package com.bhajanswarupa.paginationutils;

import java.util.List;

/**
 * Interface describing a paginated list. Page numbers start at 0.
 * 
 * @author arunc
 */
public interface Page<T> {

	int PAGESIZE_ALLRESULTS = -1;
	
	int FIRST_PAGE = 0;


	/**
	 * Returns <code>true</code> if current page number is 0 and
	 * <code>false</code> otherwise.
	 * 
	 * @return <code>true</code> if the we're on the first page and
	 *         <code>false</code> otherwise
	 */
	boolean isFirstPage();


	/**
	 * @return <code>true</code> if we're on the last page <code>false</code> if
	 *         we're not on the last page
	 */
	boolean isLastPage();


	/**
	 * @return
	 */
	boolean getHasNextPage();


	/**
	 * @return
	 */
	boolean getHasPreviousPage();


	/**
	 * @return
	 */
	int getLastPageNumber();


	/**
	 * @return
	 */
	List<T> getThisPageElements();


	/**
	 * @return
	 */
	int getTotalNumberOfElements();


	/**
	 * @return
	 */
	int getFirstResultNumber();


	/**
	 * @return
	 */
	int getLastResultNumber();


	/**
	 * @return
	 */
	int getNextPageNumber();


	/**
	 * @return
	 */
	int getPreviousPageNumber();


	/**
	 * @return
	 */
	int getPageSize();


	/**
	 * @return
	 */
	int getPageNumber();

}
